
<?php
if (isset($res_art)) {
    if (!mysqli_num_rows($res_art)) { ?>
        <div class="alert alert-warning center-block text-center half-size">
            Vous n'avez pas encore posté un article.
        </div>
    <?php }
    elseif (isset($row_art_stat)) { ?>
    <div class="clearfix stat">
        <div class="half-size pull-left border-right text-center">
            <h4>Nombre d'articles publiés : <?= $row_art_stat['nb'] ?></h4>
        </div>
        <div class="half-size pull-left padding-left text-center">
            <h4>Note moyenne des articles publiés :
                <?= colorNote($row_art_stat['moy']) ?>
            </h4>
        </div>
    </div>
    <?php }
    while ($row_art = mysqli_fetch_array($res_art)) { ?>

    <div class="list-article clearfix <?= colorStatus($row_art['statusID']) ?>">
    <?php if(isset($row_art['link']) && $row_art['imgStatus'] != 3) { ?>
            <img src="<?= imgLink($row_art['link']) ?>" />
    <?php } else { ?>
            <img src="<?= imgLink("img/blockedImg.png") ?>" />
    <?php }?>
        <div>
            <div class="clearfix">
                <h2 class="pull-left"><a href="<?= WEBROOT ?>article/article.php?id=<?php echo $row_art['id']; ?>" ><?php if(isset($row_art['title'])) { echo $row_art['title']; } ?></a></h2>
                <div class="note pull-right">
                    <?= colorNote($row_art['note']) ?>
                </div>
            </div>
            <div>
                <?php if(isset($row_art['date'])) { echo strftime("le %d %B %Y à %H:%M:%S",strtotime($row_art['date'])); } ?>
                <span>&#160;&#160;&mdash;&#160;&#160;</span>
                <?php if(isset($row_art['type'])) { echo $row_art['type']; } ?>
            </div>
            <p><?php if(isset($row_art['content'])) { echo substr($row_art['content'], 0, 200)."..."; } ?></p>

        </div>

    </div>

<?php }
 } ?>